import request from '@/utils/request'

// 查询立减活动列表
export function listReductionActivity(query) {
  return request({
    url: '/market/reductionActivity/list',
    method: 'get',
    params: query
  })
}
// 查询标签列表
export function listReductionActivity2() {
  return request({
    url: '/market/reductionActivity/labelActivityList',
    method: 'get',
  })
}

// 查询立减活动详细
export function getReductionActivity(activityId) {
  return request({
    url: '/market/reductionActivity/' + activityId,
    method: 'get'
  })
}

// 新增立减活动
export function addReductionActivity(data) {
  return request({
    url: '/market/reductionActivity',
    method: 'post',
    data: data
  })
}

// 修改立减活动
export function updateReductionActivity(data) {
  return request({
    url: '/market/reductionActivity',
    method: 'put',
    data: data
  })
}

// 删除立减活动
export function delReductionActivity(activityId) {
  return request({
    url: '/market/reductionActivity/' + activityId,
    method: 'delete'
  })
}

// 导出立减活动
export function exportReductionActivity(query) {
  return request({
    url: '/market/reductionActivity/export',
    method: 'get',
    params: query
  })
}

// 修改启用状态
export function updateStatus(activityId) {
  return request({
    url: '/market/reductionActivity/changeActivityEnabled',
    method: 'get',
    params:{ activityId }
  })
}


// 查看是否开启每升立减活动信息展示
export function getReductionShowInfoApi() {
  return request({
    url: '/enterprise/info/get/show',
    method: 'get',
  })
}

// 修改是否开启每升立减活动信息展示
export function updateReductionShowInfoApi(isShow) {
  return request({
    url: '/enterprise/info/show/activity',
    method: 'get',
    params:{isShow}
  })
}
